-- local getcuixitargets = function (player)
--   local targets = {}
--   local n = -1
--   for _, p in ipairs(Fk:currentRoom().alive_players) do
--     if player:distanceTo(p) > n and player:inMyAttackRange(p) then
--       targets = {p.id}
--       n = player:distanceTo(p)
--     elseif player:distanceTo(p) == n then
--       table.insert(targets, p.id)
--     end
--   end
--   return targets
-- end
local cuixi = fk.CreateSkill{
  name = "wk_heg__cuixi",
}


Fk:loadTranslationTable{
  ["wk_heg__cuixi"] = "摧袭",
  [":wk_heg__cuixi"] = "出牌阶段限一次，你可以与你攻击范围内你计算距离最大的所有角色依次弃置一张牌，若这些牌牌名各不相同，你对其中一名角色造成1点伤害并结束此阶段。",
  ["#wk_heg__cuixi-damage"] = "摧袭：选择一名角色，令其受到1点伤害",
}

--   anim_type = "offensive",
--   max_phase_use_time = 1,
--   card_num = 0,
--   target_num = 0,
--   card_filter = Util.FalseFunc,
--   target_filter = function (self, to_select, selected, selected_cards, card, extra_data, player)
--     if table.contains(getcuixitargets(player), to_select) then
--       table.insertIfNeed(selected, to_select)
--       ClientInstance.current_request_handler.scene:update("Photo", to_select, {state = "candidate", selected = true, enabled = true})
--       return true
--     end
--     return false
--   end,
--   feasible = function (self, selected, selected_cards, player)
--     for n, _ in ipairs(selected) do
--       table.remove(selected, n)
--     end
--     for _, pid in ipairs(getcuixitargets(player)) do
--       table.insertIfNeed(selected, pid)
--       ClientInstance.current_request_handler.scene:update("Photo", pid, {state = "candidate", selected = true, enabled = true})
--     end
--     return true
--   end,
--   on_use = function (self, room, effect)
--     local player = room:getPlayerById(effect.from)
--     local targets = effect.tos
--     local victims = table.simpleClone(targets)
--     table.insertIfNeed(targets, player.id)
--     room:sortPlayersByAction(targets)
--     --room:doIndicate(player.id, targets)
--     local names, same, discard = {}, false, false
--     for _, pid in ipairs(targets) do
--       local p = room:getPlayerById(pid)
--       if not p:isNude() then
--         local cards = room:askForDiscard(p, 1, 1, true, self.name, false)
--         if not discard and #cards > 0 then
--           discard = true
--         end
--         if not same then
--           for _, cid in ipairs(cards) do
--             local name = Fk:getCardById(cid).trueName
--             if table.contains(names, name) then
--               same = true
--             else
--               table.insert(names, name)
--             end
--           end
--         end
--       end
--     end
--     if not same and discard and not player.dead then
--       victims = table.filter(victims, function (pid) return not room:getPlayerById(pid).dead end)
--       if #victims > 0 then
--         local t = room:askForChoosePlayers(player, victims, 1, 1, "#wk_heg__cuixi-damage", self.name, false)
--         if #t > 0 then
--           room:damage({
--             from = player,
--             to = room:getPlayerById(t[1]),
--             damage = 1,
--           })
--           player:endPlayPhase()
--         end
--       end
--     end
--   end,
  -- target_tip = function (self, to_select, selected, selected_cards, card, selectable, extra_data)
  --   --if not table.contains(Self.player_skills, self) then return end
  --   local targets = getcuixitargets(Self)
  --   if table.contains(targets, to_select) or to_select == Self.id then
  --     return { {content = self.name, type = "normal"} }
  --   end
  -- end,
-- }

return cuixi